package com.moge.anjian.utils;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;

import com.moge.anjian.activities.AnjianRuleActivity;
import com.moge.anjian.activities.MainActivity;
import com.moge.anjian.activities.RecordActivity;
import com.moge.anjian.activities.TestActivity;

public class PageUtils {

    public static boolean isAccessibilityEnabled() {
//        return MyAccessibilityService.isEnabled;
        return true;
    }

    public static void goAccessibilityPage(Activity activity) {
        Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
        activity.startActivity(intent);
    }

    public static void goAppDetailPage(Activity activity) {
        Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
                .setData(Uri.parse("package:" + activity.getPackageName()));
        activity.startActivity(intent);
    }

    public static void goRulePage(Activity activity) {
        Intent intent = new Intent(activity, AnjianRuleActivity.class);
        activity.startActivity(intent);
    }

    public static void goOverDraw(Activity activity) {
        Intent mIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                Uri.parse("package:${packageName}"));
        activity.startActivity(mIntent);
    }

    public static void goTestPage(Activity activity) {
        Intent intent = new Intent(activity, TestActivity.class);
        activity.startActivity(intent);
    }

    public static void goHomeScreen(Activity activity) {
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_HOME);
        activity.startActivity(intent);
    }

    public static void goPlayBack(Activity activity) {

        Intent intent = new Intent(activity, RecordActivity.class);
        activity.startActivity(intent);
    }
}
